/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Communication;

import java.io.Serializable;

/**
 *
 * @author Administrador
 */
public class Message implements Serializable {
    private String nickTo;

    private AddressMachine from;
    private String body;
    private int type;
    public static int REGISTER = 0;
    public static int CHAT = 1;
    public static int UNREGISTER = 2;
    public static int LOOKUP = 3;
    public static int RESPONSEDISPATCHER = 4;
    public static int SUCCESS=5;
    public static int FAIL=6;

    public Message() {
    }

    public Message(String nickTo, AddressMachine from, String body, int type) {
        this.nickTo = nickTo;
        this.from = from;
        this.body = body;
        this.type = type;
    }

    public AddressMachine getFrom() {
        return from;
    }

    public void setFrom(AddressMachine from) {
        this.from = from;
    }

    public String getNickTo() {
        return nickTo;
    }

    public void setNickTo(String nickTo) {
        this.nickTo = nickTo;
    }

    public int getType(){
        return this.type;
    }

    public void setType(int elTipo){
        this.type=elTipo;
    }

    /**
     * @return the body
     */
    public String getBody() {
        return body;
    }

    /**
     * @param body the body to set
     */
    public void setBody(String body) {
        this.body = body;
    }
    
}
